home *** CD-ROM | disk | FTP | other *** search
/ Power Utilities / Power Utilities.iso / utility / pro179 / dislite.doc < prev    next >
Encoding:
Text File  |  1993-04-01  |  22.1 KB  |  502 lines

  1.                                     DISLITE
  2.  
  3.                        Executable file expander version 1.15
  4.  
  5.  
  6.  
  7. CONTENTS
  8.  
  9.          WARRANTY                           MESSAGES
  10.      COPYING                            BUGS
  11.          WHAT                               PRICE
  12.          WHY                                THANKS
  13.          HOW                                NEW
  14.          LIMITS                             NOTE
  15.      TECHS                              WHO
  16.  
  17.  
  18.  
  19. WARRANTY
  20.  
  21.    NONE! THIS PROGRAM COMES 'AS IS'. I CANNOT BE HELD RESPONSIBLE FOR
  22.    ANY DAMAGE CAUSED BY THE USE OR MISUSE THIS PROGRAM. I CANNOT
  23.    GUARANTEE THE FITNESS OF THIS PROGRAM FOR ANY PARTICULAR PURPOSE.
  24.    IF THIS PROGRAM TURNS OUT TO BEHAVE UNEXPECTEDLY OR ERRONEOUSLY,
  25.    THE USER IS RESPONSIBLE, AND I CANNOT BE FORCED TO SUPPLY THE USER
  26.    WITH A FIX.
  27.    
  28.    So, now that I have the lawyers off my back (I hope), you can forget
  29.    all that capsed crap above, and read the rest of the manual, in
  30.    which I promise not to shout anymore.
  31.  
  32.  
  33.  
  34. COPYING
  35.  
  36.    You are free to distribute this program, provided that neither the
  37.    program nor this document are changed, and the program and this
  38.    document are kept together. Only a marginal fee may be asked for
  39.    shipment and handling when distributing. You are not allowed to
  40.    sell this program.
  41.  
  42.    Now that the black-market pirates are away too, we can get to business.
  43.  
  44.  
  45.  
  46. WHAT
  47.  
  48.    DISLITE expands all programs compressed by PKLITE to their
  49.    original image. Expanding your files has many benefits over leaving
  50.    them in their compressed state.
  51.  
  52.    Most important, the uncompressed image can be examined by other
  53.    tools, such as virus scanners. A regular virus scanner can never
  54.    detect a virus embedded in a compressed file (unless by executing
  55.    and checking for suspicious actions), but on the uncompressed image
  56.    a much faster pattern matching algorithm can be used.
  57.    
  58.    Then, PKLITE compressed programs can hardly be compressed any further
  59.    using "regular" file compressors like UC2, ARJ. The uncompressed files
  60.    however, usually compress quite well using these products, and normally
  61.    the result of compressing the original file is better than that
  62.    achieved when first compressing with PKLITE, and then with another
  63.    compression utility. (Though not always)
  64.    
  65.    The same argument usually holds if you are using products like Stacker
  66.    or SpeedStor to enlarge your disk, which could be considered as
  67.    compression utilities on-the-fly. It would be silly to have a second,
  68.    almost useless, compression slowing down your system.
  69.  
  70.    In a similar context can be mentioned that some people prefer other
  71.    executable processors, such as DIET, to recompress the files.
  72.    
  73.    Then there is an increase in execution speed of uncompressed files,
  74.    because the uncompression is no longer needed before execution. This
  75.    may, on the other hand, not be true on fast machines with slow drives.
  76.    In these circumstances the compressed file might actually execute
  77.    quicker because there is less disk access.
  78.    
  79.    Finally, for the compression-hunters, there are a few extra's in this
  80.    program that lets you strip unnecessary information off of the
  81.    executables, making it a tad smaller.
  82.  
  83.  
  84.  
  85. WHY
  86.  
  87.    You could ask why this separate program is necessary, as PKLITE
  88.    has the -x option to "extract" (I'd rather call it uncompress)
  89.    a compressed files.
  90.    
  91.    The answer is simple. There is also an option in the commercial
  92.    version of PKLITE to generate "unextractable" files (-e). Needless
  93.    to say there are numerous programs available nowadays in this
  94.    "unextractable" format.
  95.    
  96.    Also, with almost minimal effort it is quite easy to modify a
  97.    PKLITE compressed file in such a way that "PKLITE -x" cannot
  98.    handle it anymore. There are even tools around that do exactly
  99.    this.
  100.    
  101.    DISLITE has the capability of expanding both "unextractable" files
  102.    and slightly modified files to their original image. Notice that
  103.    CHK4LITE that comes with PKLITE is also not able to recognise
  104.    modified PKLITE compressed files. Use "DISLITE -l" to determine
  105.    if a file is compressed by PKLITE or not. See the HOW section for
  106.    info on the -l option.
  107.    
  108.    
  109.    You should NOT use DISLITE to undo an erroneous "PKLITE -e" done
  110.    on your recently compiled fantastic program, to do a binary
  111.    compare with the latest version of your fantastic program. To
  112.    make a binary compare all parts of the executable have to be
  113.    restored exactly as they were, and the "PKLITE -e" process
  114.    throws some information away that is subsequently lost.
  115.    
  116.    Needless to say the information lost during extra compression is not
  117.    important to run your program.
  118.    
  119.  
  120.  
  121. HOW
  122.  
  123.    Usage of DISLITE is very simple. Just type:
  124.    
  125. > DISLITE file
  126.  
  127.    to decompress the executable file.EXE or file.COM in the
  128.    current directory. You can also specify two filenames in which
  129.    case the first file is left intact and the decompressed program
  130.    is written to the second filename.
  131.    
  132.    If you type DISLITE without any parameters, the following help screen
  133.    appears to remind you of the possible options:
  134.  
  135.     Usage: DISLITE [options] [d:][\path]Infile [[d:][\path]Outfile]
  136.     Options are:
  137.       -b = make backup .BAK file of original
  138.       -cN = N is max number of segments
  139.       -e = extract unextractable file (*)
  140.       -f = un-do the fixup optimizations done by HDROPT & `extra`
  141.       -h = remove irrelevant header data
  142.       -k = omit kludge code added on some files
  143.       -l = only list version info
  144.       -o = overwrite output file if it exists
  145.       -p = align text data on a page
  146.       -r = remove overlay data
  147.       -s = silent, do not generate any warnings
  148.       -u = update file time/date to current time/date
  149.       -v = verbose
  150.  
  151.    In fact the options can appear anywhere on the command line, not just
  152.    directly after the program name. Options can always be combined,
  153.    so "-b -v -h" can be abbreviated as "-bvh". You can also use the switch
  154.    character (usually '/', but it could be set to anything) as the option
  155.    indicator. In case you use '/', the program tries to be smart and figures
  156.    out whether you mean a filename or indeed an option (since you can use
  157.    the '/' character as a directory separator too). In case of difficulty,
  158.    use '-' and '\'. (More specific: DISLITE will only recognise an option
  159.    initiated with '/' as option if every following character is a valid
  160.    option.)
  161.    
  162.    A short description of all possible options follows:
  163.    
  164.    -b  This option makes a backup of the compressed file image, which
  165.        has the same name and path as the Infile, but the extension .BAK.
  166.        Any existing file with that name will automatically be overwritten.
  167.     
  168.    -c  This option sets the maximum number of segments in a compressed
  169.        program that DISLITE can handle. Notice that running out of segments
  170.        only produces a warning or two. If memory is short, reducing the
  171.        number of segments increases the amount of fixups DISLITE can handle.
  172.        (It is essential that there is enough memory for fixups).
  173.        If you are combining options, the c option should always be the last
  174.        letter in a sequence. You can put the number either directly after
  175.        the 'c' or separate them with a space.
  176.    
  177.    -e  This option is completly ignored by the program. Use it to your
  178.        hearts contents to spell interesting words using the option
  179.        letters. You might find "DISLITE -less" easier to remember than
  180.        "DISLITE -ls" to which it is otherwise functionally the same.
  181.        Notice that most option letters have no effect when you specify
  182.        them more than once.
  183.  
  184.    -f  This option undoes the effect of "HDROPT", and also the optimization
  185.        done by "PKLITE -e" extra compression, which is the same. The fixups
  186.        are rearranged such that they become relative to the observed segments
  187.        in the executable. This is automatically done for extra compressed
  188.        files.
  189.        
  190.    -h  Most linkers include in the exe file header some information that
  191.        is not needed for program execution in any way, information that
  192.        might be used by a debugger later. Use this option to remove that
  193.        information from the executable. (For the technically gifted:
  194.        the information between the end of the documented DOS header, and
  195.        the start of the relocation table. PKLITE ignores all information
  196.        after the relocation table in the header, so that is lost forever
  197.        after using any PKLITE compression method.)
  198.        Note that this option has no effect on .COM files as they have no
  199.        exe header, and neither on extra-compressed files, as the extra
  200.        header data is then removed by PKLITE on compression.
  201.        
  202.    -k  Files compressed using PKLITE version 1.15 extra compression or
  203.        higher, set a word in memory during decompression, so the
  204.        compressed program can check if it was running compressed.
  205.        If DISLITE detects this, it automatically inserts code to mimic
  206.        the behaviour of the PKLITE decompression, adding 4 to 11 bytes
  207.        of code to the program, depending on some program properties.
  208.        If you don't want this kludge code to be automatically added,
  209.        specify this option.
  210.        IMPORTANT! If you decompress PKZIP 2.04g using the -k switch,
  211.        then the resulting PKZIP executable will CAUSE DAMAGE TO YOUR FILES
  212.        if you run it! Be aware!
  213.        
  214.    -l  Only list the version of PKLITE that compressed the file, don't
  215.        decompress anything. This is especially useful with the '-s' option
  216.        because DISLITE outputs one single line for a file in that case.
  217.        None of the other options have any effect with the -l option.
  218.  
  219.    -o  Use this option to overwrite an output file that already exists.
  220.        Note that files with extensions .BAK and .$$$ with the name of
  221.        the Infile are always overwritten (provided these files are
  222.        generated by the program. You normally never see .$$$ but this
  223.        is used as an interim file in case you only specify an Infile).
  224.    
  225.    -p  Align text data on a page. This option can be used for any .EXE
  226.        file, to make the exe header a multiple of 512 bytes. Some say
  227.        that the executable loads faster if this is the case. Most linkers
  228.        generate executables this way.
  229.    
  230.    -r  Remove any overlay data present. Overlay data is data after the
  231.        executable file image until the physical end of file. DISLITE
  232.        never complains when overlays are present, it normally just copies
  233.        the overlays.
  234.        
  235.    -s  Be silent. No warnings are given, and the header is suppressed
  236.        too. Usefull for background or batch execution.
  237.    
  238.    -u  Update time. Use this option to set the file date/time stamp to
  239.        the current time. Normally, DISLITE leaves the file date/time
  240.        of the file the same (even when you specify an Outfile).
  241.    
  242.    -v  Be verbose. When you use this option, you will get a more 
  243.        detailed progress indicator, and lots and lots of information
  244.        about the file being uncompressed. Recommended to the nosey.
  245.  
  246.  
  247.  
  248. LIMITS
  249.  
  250.    DISLITE uses quite a lot of memory. I haven't exactly calculated it,
  251.    but I expect you need approximately 150K + the amount the expanded
  252.    program takes to execute. In case you have not enough memory available,
  253.    DISLITE will first try to shrink its buffers a little (upto a certain
  254.    point), but this can lead to errors like "Too many fixups, sorry".
  255.  
  256.    DISLITE can only handle executables with upto 16384 fixups. If you find
  257.    a file with more fixups, asking me nicely to provide a new version of
  258.    DISLITE might help. 
  259.  
  260.    The program uses the built-in extractor of the executable, and
  261.    therefore a very smart virus can get hold of your system if you
  262.    expand a compressed file which had a virus infecting it after
  263.    compression. But since DISLITE disallows DOS and BIOS access for the
  264.    expanding program, the chances that you actually catch a virus
  265.    that infected a compressed file are much larger. See the TECHS
  266.    section for more info.
  267.    
  268.    The "effective compression" ratio as described under MESSAGES can
  269.    give odd or incorrect results if you specify one of the -hpr
  270.    options.
  271.    
  272.  
  273.  
  274. TECHS
  275.  
  276.    As said in the previous section, DISLITE uses the extractor built
  277.    into the compressed file to decompress it. There is a little
  278.    debugger inside DISLITE that allows it to only execute the built-in
  279.    decompressor and extract information from it at the same time.
  280.    But because DISLITE is still based on particular details about the
  281.    built-in decompressor, there can always be ways around it. Therefore
  282.    I do not guarantee that DISLITE will work for future version of
  283.    PKLITE.
  284.    
  285.    Nevertheless, DISLITE has been thoroughly tested on files generated by
  286.    PKLITE versions 1.03 - 1.15, and also works for the 1.20 compressed
  287.    files that are available.
  288.    
  289.    When debugging the program that is decompressed, DOS and BIOS
  290.    interrupts are disabled. But in case such an interrupt is called
  291.    anyway, DISLITE displays the offending interrupt number and follows
  292.    with a dump of all internal registers. This might indicate several
  293.    things: If you had previous warnings about an unrecognised PKLITE
  294.    version, that is likely to be cause of the troubles. If you
  295.    haven't, someone might have modified the compressed program.
  296.    This modification could have been done by the original programmer
  297.    on purpose, or, as a final case, by a virus.
  298.  
  299.    .COM files are always extracted to their original image, and so are
  300.    normal compressed .EXE files. (Well, at least restored just as
  301.    PKLITE -x would restore them. If there was any information stored
  302.    after the relocation table, that is lost.)
  303.  
  304.    Extra compressed .EXE files can not be restored to their original
  305.    image exactly. As said before, the information stored in the header
  306.    just after the DOS documented .EXE header and before the relocation
  307.    table cannot be recovered. This information is not needed anyway.
  308.    Further, there are 3 entries in the .EXE header that can not be
  309.    recovered completely. Two of these, the headersize and the position
  310.    of the relocation table follow from the fact that the additional
  311.    header data is lost.
  312.    
  313.    The third entry that can not be completely recovered is the minimum
  314.    memory to allocate to the program. This value might be a little bigger
  315.    in the newly extracted image as compared to the original one. In case
  316.    you have such a critical memory setup that the program cannot execute
  317.    with this larger minimum memory requirement, it wouldn't have done so
  318.    *with* the PKLITE decompression code either. Resuming, this is again not
  319.    a great loss.
  320.    
  321.    However, DISLITE is very well able to *completely* restore the relocation
  322.    or fixup table. In fact DISLITE goes through some trouble finding the
  323.    right segment for each fixup, as PKLITE -e kindly throws that information
  324.    away. However, if there isn't enough memory to store the segments used
  325.    in the compressed program, then the fixups aren't restored completely.
  326.    This doesn't have any impact on the execution of the program.
  327.  
  328.  
  329.  
  330. MESSAGES
  331.  
  332.    Many! DISLITE is stuffed to under its chin with all kinds of information
  333.    messages, most of which are self-explanatory. I will, however, name
  334.    some.
  335.    
  336.    There are four types of messages DISLITE can produce: informational,
  337.    harmless warnings, warnings, and errors.
  338.    
  339.    Informational messages are enabled with the -v option. They include:
  340.    progress indicators, and various file information. There are two
  341.    compression ratio's mentioned for .EXE files: the real compression and
  342.    the effective compression. The real compression is the compression of
  343.    text (executable) data, as achieved by the PKLITE algorithms, and the
  344.    effective compression is the file-to-file overall compression factor,
  345.    the one that PKLITE displays. This latter value might not be correct
  346.    in all circumstances. See the LIMITS section.
  347.    
  348.    Harmless warnings are indications that something isn't going as it
  349.    should, but the decompression process isn't seriously hindered by
  350.    it. The only harmless warning that you might react upon is:
  351.  
  352. Harmless warning: Fixup segments don't match observed segments.
  353. You might use '-f' to correct this.
  354.    
  355.    This might be the result of a program that is first processed with
  356.    HDROPT and then compressed using normal compression. If you specify
  357.    the -f switch, as indicated, then both the compression *and* the
  358.    optimizations done by HDROPT are undone.
  359.    
  360.    The harmless warning "Cannot fix fixups" indicates that there wasn't
  361.    enough memory to store all segments found in the program, and as a
  362.    result the fixups cannot be restored completely.
  363.  
  364.  
  365.    A warning is given if DISLITE has serious doubts about the program
  366.    you want to uncompress. For example if you specified a file without
  367.    an executable extension.
  368.  
  369.    You are asked to confirm before proceeding. Setting -s inhibits all
  370.    warning messages.
  371.  
  372.  
  373.    There are innumerable errors, mostly DOS errors of the format
  374.    "short explanation:DOS error description". These are all of the type
  375.    "get your dirty hands off that disk drive door and retry". DISLITE
  376.    can't do much about it.
  377.  
  378.    There are some DISLITE specific errors, like "Cannot find end of
  379.    decode loop."; or "Unexpected interrupt xxh from processed program.",
  380.    followed by a dump of all CPU registers; or "Not enough memory." or
  381.    "Too many fixups, sorry."
  382.  
  383.    This all means that DISLITE can no longer keep track of what's happening,
  384.    and gives up. Increasing the memory available to DISLITE might help.
  385.    If it doesn't, blame PKWARE for bringing out an incompatible version of
  386.    PKLITE. (And start looking for an updated DISLITE :-)
  387.    
  388.    The only likely error is that of an unexpected exit from the compressed
  389.    program, which normally means you pressed Ctrl-Break.
  390.  
  391.    You cannot turn off the errors or stop them from aborting the program.
  392.  
  393.  
  394.  
  395. BUGS
  396.  
  397.    Well I've eliminated the One remaining bug in DISLITE v 1.01 :), but
  398.    there is a slight change that the enhancements might have incorporated
  399.    new bugs. If you find something that shouldn't occur according to you,
  400.    you're free to send me a mail (see WHO section below).
  401.  
  402.  
  403.  
  404. PRICE
  405.  
  406.    Zero! Give this away to all your friends, especially if their initials
  407.    are PK ;-) But of course donations are greatly appreciated. See the
  408.    WHO section below to know where to send your money.
  409.    
  410.    
  411.  
  412. THANKS
  413.  
  414.    Special thanks to CV-Tassle for upgrading DISLITE to be able to handle
  415.    1.14+ compressed files and for various other functions and bugfixes.
  416.    Also thanks to Nico for getting the bugs out of the manual (old credit
  417.    that still had to be paid).
  418.    And last but not least, thanks to Sabine for being so patient with me.
  419.  
  420.  
  421.  
  422. NEW
  423.  
  424.    New in version 1.15 is the ability to deal with 1.14 and 1.15 compressed
  425.    files, and with the PKLITE 1.20 extra compressed programs that were
  426.    available.
  427.    
  428.    All undocumented options of v. 1.01 have changed. I don't think that
  429.    anybody will regret the loss of -l for the new functionality :)
  430.    -c changed because what it orginally served was no longer useful;
  431.    "crippled" files are now automatically handled properly. The -d
  432.    option disappeared as it was unsafe to use.
  433.    
  434.    Fixed a bug reporting out of memory while processing fixups.
  435.    
  436.    Added a progress indicator that provides for some entertainment while
  437.    you await the decompression process.
  438.    
  439.    Greatly enhanced detection of PKLITEd executables! Even if the
  440.    "PKLITE" indentification string is removed, DISLITE is still able
  441.    to tell if an executable is compressed by PKLITE.
  442.    
  443.    Output files are no longer silently overwritten.
  444.  
  445.  
  446.  
  447. NOTE
  448.  
  449.    A note to people who are concerned about DISLITE removing the PKLITE -e
  450.    "protection" from a program:
  451.  
  452.    As a software developer, if you want to make your programs tamper-proof,
  453.    you should not rely on any single method, and certainly not on anything
  454.    so easy to circumvent (and so widespread) as PKLITE -e. Any good cracker
  455.    can undo the PKLITE compression with a debugger in a few minutes. The
  456.    best protection is to be creative. Checksumming the executable in a
  457.    complicated way and using the result to initialise some variables could
  458.    be a nice suggestion. Make sure your program does lots of other things
  459.    preferably with a lot of procedure calls before the actual check
  460.    appears.  There's nothing so easy as skipping the first procedure call.
  461.  
  462.    Three notes from the developers of DISLITE to all evil people out there:
  463.  
  464.    Note to would-be crackers of PKZIP 2.04:
  465.    In addition to the PKLITE compression (which DISLITE 1.15 will expand),
  466.    there is internal encryption of portions of the code within the 
  467.    executables. DISLITE 1.15 does not concern itself with this. If you 
  468.    want to crack the PKZIP internals, you are on your own.
  469.    Forget it--Get a life!
  470.  
  471.    Note to any crackers of any software:
  472.    If you really need DISLITE to get around the PKLITE compression, then
  473.    you're obviously no-good! Why are you wasting your time on this anyway,
  474.    don't you have something better to do? If you are such a genuis on the
  475.    keyboard as you keep saying to yourself, why don't you write a useful
  476.    program?
  477.  
  478.    Note to would-be defeaters of DISLITE:
  479.    Forget it. We can always figure out how to expand it. If the
  480.    processor can expand it at run time, then some program can expand
  481.    it too. Your last attempt was valiant, and only worked as long as it
  482.    did because we had other demands on our time. However, you have our
  483.    admiration for such a fine program as PKLITE.
  484.  
  485.  
  486.  
  487. WHO
  488.  
  489.    I can be reached:
  490.    
  491.       Jan-Pieter Cornet
  492.       Aletta Jacobsstraat 8
  493.       2642 AD  Pijnacker
  494.       Netherlands
  495.       phone: +31 1736 98480
  496.       Email: cornet@duteca.et.tudelft.nl
  497.           or ba132@cleveland.freenet.edu
  498.  
  499.  
  500. DISLITE (pd)   Executable File Expander   Version 1.15   Apr 2, 1993
  501. Copyleft 1991-1993 JohnPC & CV-Tassle.  Say NO! to software patents.
  502.